#include "Common/Algebra/Vec4.h"

const Vec4 Vec4::ZERO_VEC( 0.0f, 0.0f, 0.0f, 0.0f );
const Vec4 Vec4::ZERO_POINT( 0.0f, 0.0f, 0.0f, 1.0f );
const Vec4 Vec4::UP( 0.0f, 1.0f, 0.0f, 0.0f );
const Vec4 Vec4::DOWN( 0.0f, -1.0f, 0.0f, 0.0f );
const Vec4 Vec4::LEFT( -1.0f, 0.0f, 0.0f, 0.0f );
const Vec4 Vec4::RIGHT( 1.0f, 0.0f, 0.0f, 0.0f );
const Vec4 Vec4::FORWARD( 0.0f, 0.0f, 1.0f, 0.0f );
const Vec4 Vec4::BACK( 0.0f, 0.0f, -1.0f, 0.0f );

Vec4 Vec4::operator +=(const Vec4& v ) {
	X += v.X;
	Y += v.Y;
	Z += v.Z;
	W += v.W;
	return *this;
}

Vec4 Vec4::operator -=(const Vec4& v ) {
	X -= v.X;
	Y -= v.Y;
	Z -= v.Z;
	W -= v.W;
	return *this;
}

Vec4 Vec4::operator *=(float a) {
	X *= a;
	Y *= a;
	Z *= a;
	W *= a;
	return *this;
}

Vec4 Vec4::operator /=(float a) {
	X /= a;
	Y /= a;
	Z /= a;
	W /= a;
	return *this;
}

Vec4 Vec4::Normalize( ) {
	float len = Len( );
	X /= len;
	Y /= len;
	Z /= len;
	W /= len;
	return *this;
}
